--  ---------------------------------------------------------------------------
--  @File: settings.ads
--
--  @Project: LiberAda
--  @Created: 2009-09-23
--  @Version: 1.0
--  @Author:  Markus Knau�
--
--  @Description:
--    Stores and provides access to the LiberAda application's state.
--  @Usage:
--    The state of LiberAda is globally shared. Be carefull when altering
--    a value because the alteration may have unexpected effects.
--
--  @Modifications:
--    +2009-09-23 MK: Initial release
with Ada.Strings.Unbounded;

package Settings is

   --  ------------------------------------------------------------------------
   --  @Type: Extensions_Type
   --  @Purpose:
   --    Is used for storing a list of file name extensions that indicate the
   --    type of the content of a file. The list of extensions contains
   --    those files for which documentation is generated.
   type Extensions_Type is array (Natural range <>)
     of Ada.Strings.Unbounded.Unbounded_String;

   --  ------------------------------------------------------------------------
   --  @Type: Source_Files_Type
   --  @Purpose:
   --    Is used for storing the list of files for which documentation is
   --    generated by LiberAda.
   type Source_Files_Type is array (Natural range <>)
     of Ada.Strings.Unbounded.Unbounded_String;

   --  ------------------------------------------------------------------------
   --  @Constant: DEFAULT_BODY_EXTENSION
   --  @Purpose:
   --    The default extension of an Ada package's body.
   DEFAULT_BODY_EXTENSION : constant String := "adb";

   --  ------------------------------------------------------------------------
   --  @Constant: DEFAULT_SPEC_EXTENSION
   --  @Purpose:
   --    The default file name extension for an Ada package's specification.
   DEFAULT_SPEC_EXTENSION : constant String := "ads";

   --  ------------------------------------------------------------------------
   --  @Constant: DEFAULT_OUTPUT_DIRECTORY
   --  @Description:
   --    The default directory to which the generated LiberAda documentation
   --    is written.
   DEFAULT_OUTPUT_DIRECTORY : constant String := ".";

   --  ------------------------------------------------------------------------
   --  @Procedure: Set_Recursive
   --  @Description:
   --    Sets recursive mode. In recursive mode a directory is not only
   --    scaned for contained source files but also all sub-directories
   --    are scaned for source files.
   --  @Parameter:
   --    +Recurse: True if recurse mode is enabled otherwise false.
   procedure Set_Recursive (Recurse : Boolean);

   --  ------------------------------------------------------------------------
   --  @Funtion: Recursive
   --  @Description:
   --    Returns if recursive mode is set.
   --  @Return:
   --    True if recursive mode is set otherwise false.
   function Recursive return Boolean;

   --  ------------------------------------------------------------------------
   --  @Procedure: Add_Extension
   --  @Description:
   --    Adds an file name extension to the list of file name extensions of
   --    files for which documentation is created.
   --  @Parameter:
   --    +Extension: to add
   procedure Add_Extension (Extension : in String);

   --  ------------------------------------------------------------------------
   --  @Function: Has_Allowed_Extension
   --  @Description:
   --    Determines if a given file name has an extension that is allowed.
   --    Allowed means the extension was added earlier by using
   --    (@see Add_Extension).
   --  @Parameter:
   --    +File_Name: to determine if extension is allowed
   --  @Return:
   --    True if extension is allowed otherwise false
   function Has_Allowed_Extension (File_Name : in String) return Boolean;

   --  ------------------------------------------------------------------------
   --  @Function: Extensions
   --  @Description:
   --    Returns all allowed extensions that were added using
   --    (@see Add_Extension).-
   --  @Return:
   --    Array of allowed extensions.
   function Extensions return Extensions_Type;

   --  ------------------------------------------------------------------------
   --  @Procedure: Set_Output_Directory
   --  @Description:
   --    Sets the directory to which documentation generated by LiberAda
   --    is written.
   --  @Paramter:
   --    +Output_Dir: directory to write documentation to
   procedure Set_Output_Directory (Output_Dir : in String);

   --  ------------------------------------------------------------------------
   --  @Function: Output_Directory
   --  @Description:
   --    Returns the directory to which generated documentation is written.
   --  @Return:
   --    Directory to write documentation to
   function Output_Directory return String;

   --  ------------------------------------------------------------------------
   --  @Procedure: Add_Source_File
   --  @Description:
   --    Adds a file to the list of files for which LiberAda will generate
   --    documentation.
   --  @Paramter:
   --    +Name: of source file to generate documentation for
   procedure Add_Source_File (Name : in String);

   --  ------------------------------------------------------------------------
   --  @Function: Has_Source_File
   --  @Description:
   --    Determines if a specific source file was already added to the list
   --    of files for which documentation is generated.
   --  @Parameter:
   --    +Name: of file to determine if it was added
   --  @Return:
   --    True if file was already added otherwise false
   function Has_Source_File (Name : in String) return Boolean;

   --  ----------------------------------------------------------------------
   --  @Function: Has_Source_Files
   --  @Description: Determines if there are any source files.
   --  @Return: True if there are source files otherwise false.
   function Has_Source_Files return Boolean;

   --  ------------------------------------------------------------------------
   --  @Function: Source_Files
   --  @Description:
   --    Returns all source files for which documentation is generated.
   --  @Return:
   --    List of source files for which documentation is generated.
   function Source_Files return Source_Files_Type;

   --  ------------------------------------------------------------------------
   --  @Procedure: Set_Verbose
   --  @Description:
   --    Sets verbose mode of LiberAda. In verbose mode diagnostic messages
   --    are printed to the console to see how LiberAda proceeds.
   --  @Parameter:
   --    +Verbose: Flag indicating if verbose mode is enabled
   procedure Set_Verbose (Verbose : in Boolean);

   --  ------------------------------------------------------------------------
   --  @Function: Verbose
   --  @Description:
   --    Returns if verbose mode is enabled.
   --  @Return:
   --    True if verbose mode is enabled otherwise false.
   function Verbose return Boolean;

   --  ------------------------------------------------------------------------
   --  @Procedure: Read_From_Command_Line
   --  @Description:
   --    Reads the command line arguments and sets the current
   procedure Read_From_Command_Line;

end Settings;
